package com.example.pc.system_broadcastreceiver.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.Toast;

import com.example.pc.system_broadcastreceiver.MainActivity;

public class BootBroadcastReceiver extends BroadcastReceiver {


    private String TAG = BootBroadcastReceiver.class.getSimpleName();

    @Override
    public void onReceive(Context context, Intent intent) {

        Log.d(TAG, "onReceive: 系统开机了...");
        Toast.makeText(context, "系统开机了...", Toast.LENGTH_SHORT).show();


        Intent intent1 = new Intent(context, MainActivity.class);
        intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent1);



    }


}
